package exo1;

import exo1.Point;

public class Cercle extends Forme  implements Checked {
	
	private Point origine;
	private double rayon;
	
	public Cercle(Point origine, double rayon) {
		super();
		this.origine = origine;
		this.rayon = rayon;
		invariant();
	}

	public Point getOrigine() {
		return origine;
	}

	public void setOrigine(Point origine) {
		this.origine = origine;
	}

	public double getRayon() {
		return rayon;
	}

	public void setRayon(double rayon) {
		this.rayon = rayon;
		invariant();
	}
	@Override
	public void dessiner(PileTransformations p){
		String s="Cercle [origine=" + origine + ", rayon=" + rayon + "]\n";
		s+="-----";
		Point point=p.depiler();
			s+=" "+point;
		s+="-----";
		System.out.println(s);
	}
	@Override
	public void  deplacer(Point point){
		origine=origine.additioner(point);
	}

	@Override
	public String toString() {
		return "Cercle [origine=" + origine + ", rayon=" + rayon + "]";
	}

	@Override
	public void invariant() {
		assert rayon!=0:"Le rayon ne peut pas etre null";
		
	}

}
